<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        
        body {
            overflow: hidden;
        }
        
        #imgbg {
            background: url("images/3aa3b1a332986b5744d7bbb4a82cab443cd71a1c.jpg") no-repeat;
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-size: 100% 730px;
            background-position-y: 0px;
            background-position-x: center;
            transition: all .4s ease-in-out;
            opacity: 1;
            background-size: cover;
        }
        
        #box {
            width: 600px;
            height: 300px;
            position: absolute;
            background: linear-gradient(90deg, #ABDCFF, #0396FF);
            left: 35%;
            top: 30%;
            border: none;
            border-radius: 10px;
            z-index: 3;
            padding: 2px 5px 2px 5px;
            outline: none;
            transition: all .4s ease-out;
        }
        
        #click {
            width: 100px;
            height: 50px;
            background-color: rgba(255, 255, 255, 0.4);
            border: 0;
            border-radius: 40px;
            cursor: pointer;
            z-index: 99;
            position: absolute;
        }
        /* 遮罩层 */
        
        #mask_layer {
            background: rgba(0, 0, 0, 0.5);
            width: 100%;
            height: 100%;
            transition: all .6s ease-in-out;
            position: absolute;
            backdrop-filter: blur(0.4);
            opacity: 0;
            z-index: 2;
        }
    </style>
</head>

<body>

    <div id="mask_layer"></div>
    <!-- 背景图片 -->
    <div id="imgbg"></div>
    <div id="cent">
        <textarea name="" id="box" cols="30" rows="10"></textarea>

        <button id="click">点击</button>
    </div>

</body>

<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js"></script>
<script>
    var box = document.querySelector("#box");
    var maskLayer = document.querySelector("#mask_layer");
    var imgbg = document.querySelector("#imgbg");

    function openBook() {
        var i = 0;
        var widthBoxSeepd = 1;
        //box盒子只有变化40次'
        var boxI = 0;
        var boxInterval = setInterval(() => {
            var speed = (5 - i) / 100;
            box.style.transform = `scale(${i})`;
            if (boxI <= 40) {
                // box.style.width = box.offsetWidth + widthBoxSeepd + "px";
                box.style.borderRadius = boxI / 5 + "px"
            }
            if (i >= 2) {
                clearInterval(boxInterval)
                    /*   setTimeout(() => {
                          //图片遮罩层
                          imgbg.style.filter = "blur(3px)";
                      }, 250) */
            }
            i += speed;
            boxI++;
        }, 5)
        setTimeout(() => {
            //图片遮罩层
            maskLayer.style.opacity = 1;
            imgbg.style.transform = "scale(1.4)";
        }, 0)
    }

    function openOnBook() {
        setTimeout(() => {
            //图片遮罩层
            maskLayer.style.opacity = 0;
            box.style.transform = "scale(1)";
            imgbg.style.transform = "scale(1)";
            // imgbg.style.filter = "blur(0px)";
        }, 0)
    }
    var a = true;
    document.querySelector("#click").addEventListener("click", () => {
        if (a) {
            openBook();
            a = false;
        } else {
            openOnBook();
            a = true;
        }

    })
</script>

</html>